<template>
      <div class="modal fade" id="delehealthinteract" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title" id="myModalLabel">
                {{modaltitle}}</h4>
                    </div>
                    <div class="modal-body">
                        <div class="fail cbafter" v-show="lookitem.verifyState=='2'">
                            
                            <div class="textdes">
                                <p class="nosuccess">审核未通过！</p>
                                 <p>{{lookitem.verifySuggestion}}</p>
                            </div>
                           
                        </div>
                         <div class="changeinfo cbafter">
                            <div class="changeinfo_head cbafter">
                                <span>申请人：{{username}}</span>
                                <span>申请时间：{{applytime}}</span>
                            </div>
                             <div class="cb changeinfo_con">
                                <h3>{{lookitem.interactionTitle}}</h3>
                                <p class="talktime">互动时间：<span>{{lookitem.interactionyear}} {{lookitem.interactiontime}}</span></p>
                                <p class="talkdoc">互动专家：<span>{{lookitem.interactionUserName}} {{lookitem.interactionUserLevelText}}</span></p>
                            </div>
                        </div>
                        <form class="form-horizontal" role="form" id="changedocform" v-on:submit.prevent="delehealthinteractsave">
                            <div class="form-group">
                                <label class="col-md-3 control-label">作废理由 :</label>
                                <div class="col-md-8">
                                    <textarea class="form-control" rows="3" placeholder="请输入作废的理由" v-model="lookitem.infoDeleteReason" required></textarea  >
                                </div>
                            </div>
                            <div class="form-group save">
                                <button type="submit" class="default ok center">确认</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
</template>
<script>
import Public from 'assets/public.js'
module.exports = {
    data() {
            return {
               lookitem:{
                  interactionTitle:"",
                  interactionyear:"",
                  interactiontime:"",
                  interactionUserName:"",
                  interactionUserLevelText:"",
                  verifyState:"",
                  infoDeleteReason:"",
                  verifySuggestion:"",
                  lectureContent:""
                },
            }
        },
        props: {
            "username": {
                type: String,
                default: ""
            },
             "applytime": {
                type: String,
                default: ""
            },
             "modaltitle": {
                type: String,
                default: ""
            },

        },
        ready() {
            var that=this;
           
        },
        methods: {
           delehealthinteract(item){
                    $("#delehealthinteract").modal("show");
                    this.modaltitle = "健康讲座作废";
                    this.username = item.infoApplyUserName;
                    this.applytime = item.infoApplyTime;
                    this.lookitem = item;
                },
                // 作废保存
                delehealthinteractsave(){
                  var that=this;
                   $.when(Public.commonajax("coms.healthInteractionService", "deleteHealthInteraction", "['" + this.lookitem.interactionId +"','"+this.lookitem.infoDeleteReason+"']"))
                        .done(function(res) {
                            if (res.code == 200) {
                               Public.ajaxPrompt("提交成功");
                               $("#delehealthinteract").modal("hide");
                                that.$dispatch('delehealthinteractsave');
                            }

                        })
                },
        },
}
</script>
<style scoped>

</style>
